$("#form_hotel_room_type input[type=text], #form_hotel_room_type select").removeClass("field-with-errors")
$("#form_hotel_room_type .error-message").html("").removeClass("red")

<% if remotipart_submitted? %>
    $('#filter_admin').hide();
    $('#admin_title').html("<%= j 'Manage Room Types' %>");
    $('#admin_content').html("<%= j render partial: 'hotel_room_types/index', locals: { :hotel_room_types => @hotel_room_types} %>")
<% else %>
    <% if @hotel_room_type.errors.any? %>
      <% @hotel_room_type.errors.each do | field, message| %>
        $("#<%=j field.to_s %>_error").html("<%=j message %>").addClass("red");
      <% end %>
    <% else %>
      $('#admin_content').html("<%=j render partial: 'hotel_room_types/index', locals: { :hotel_room_types => @hotel_room_types } %>")
      <% flash[:notice] = ' Hotel Room Type successfully created' %>
      $("#flash_message_wrapper").html("<%=j render partial: 'layouts/flash_messages' %>");
      animateFlashMessages();
    <% end %>
<% end %>